\documentclass{ctexart}
\usepackage{listings}%插入代码
\usepackage{geometry}%设置页面大小边距等
\usepackage{authblk}%作者机构等信息
\usepackage{graphicx}%插入图片
\usepackage{url}%Bib中引用网页
\usepackage{amssymb}%为了用\mathbb
\usepackage{amsmath}%数学方程的显示
%\usepackage{amsthm}%数学定理
\usepackage{listings}%插入代码
\usepackage{fancyhdr}%设置页眉页脚
\usepackage{lastpage}%总页数
\usepackage{hyperref}%引用网页
\usepackage{xcolor}
\usepackage{tikz}



\geometry{a4paper,left=2cm,right=2cm,top=2cm,bottom=2cm}%一定要放在前面！
\pagestyle{fancy}%设置页眉页脚
\lhead{周游\ 3200106105}%页眉左
\chead{Numerical Analysis homwork01}%页眉中
\rhead{2022/09/21}%章节信息
\cfoot{\thepage/\pageref{LastPage}}%当前页，记得调用前文提到的宏包
\rfoot{浙江大学数学科学学院}
\renewcommand{\headrulewidth}{0.1mm}%页眉线宽，设为0可以去页眉线
\renewcommand{\footrulewidth}{0.1mm}%页脚线宽，设为0可以去页眉线
\setlength{\headwidth}{\textwidth}

\hypersetup{%设置网页链接颜色等
    colorlinks=true,%链接将会有颜色，默认是红色
    linkcolor=blue,%内部链接，那些由交叉引用生成的链接将会变为蓝色（blue）
    filecolor=magenta,%链接到本地文件的链接将会变为洋红色（magenta）
    urlcolor=blue,%链接到网站的链接将会变为蓝绿色（cyan）
    }

\newtheorem{theorem}{Theorem}
\newtheorem{proof}{Proof:}
\newtheorem{solution}{Solution:}

\begin{document}
%\newpage
\section*{1.8.1 Theoretical questions}
\subsection*{\uppercase\expandafter{\romannumeral1}}
\begin{solution}
The width of the interval at the nth step:
\begin{equation}
    (3.5-1.5)/2^n = \frac{1}{2^{n-1}}
    \notag
\end{equation}
\end{solution}
\begin{solution}
The maximum possible distance between
the root r and the midpoint of the interval:
\begin{equation}
    \frac{1}{2^{n-1}} \div 2 = \frac{1}{2^{n}}    
    \notag
\end{equation}
\end{solution}

\subsection*{\uppercase\expandafter{\romannumeral2}}
\begin{proof}
\begin{equation}
\begin{aligned}
    n &\geqslant log_2(b_0-a_0) - long_2\epsilon - log_2a_0 -1 \\
    |x^* - x_n| &\leqslant \frac{b_0-a_0}{2^{n+1}} \\
                &\leqslant \frac{b_0-a_0}{(b_0-a_0)\cdot\frac{1}{\epsilon}\cdot\frac{1}{a_0}} \\
                & \leqslant a_0 \epsilon \\
                &\leqslant x^*\epsilon \\
     relative \  error \  \frac{|x^*-x_n|}{|x^*|} \leqslant \epsilon
\end{aligned}
    \notag
\end{equation}
\end{proof}
\subsection*{\uppercase\expandafter{\romannumeral3}}
\begin{solution}
 \begin{equation}
    \begin{aligned}
    p(x) &= 4x^3 - 2x^2 + 3 \\
    p'(x) &= 12x^2 - 4x \\
    x_{n+1} &= x_n - \frac{f(x_n)}{f'(x_n)} \\
    Step\ 1 : x_0 = -1 \\
    \textbf{切线}:\ &y - p(-1) = p'(-1)(x+1) \\
    y &= 16x+13 \\
    x_1 &= -\frac{13}{16} = -0.8125 \\
    Step\ 2 : \\
    \textbf{切线}:\ &y - p(x_1) = p'(x_1)(x+1) \\
    x_2 &= -0.7708 \\
    \cdots
\end{aligned}
    \notag
\end{equation}\\
做四次迭代，结果如下表，所以 $x^* \approx -0.7688$
\begin{table}[h!]
  \begin{center}
    %\caption{Your first table.}
    \begin{tabular}{|c|c|c|} 
    \hline
      \textbf{iteration} & \textbf{$x_n$} & \textbf{$y_n$}\\
      \hline
      1 & -0.8125 & -0.4658\\
      \hline
      2 & -0.7708 & -0.0201\\
      \hline
      3 & -0.7688 & $-4.4 \times 10^{-5}$ \\
      \hline
      4 & -0.7688 & $-2 \times 10^{-10}$ \\
      \hline
    \end{tabular}
  \end{center}
\end{table}

\end{solution}

\subsection*{\uppercase\expandafter{\romannumeral4}}
\begin{proof}
\begin{equation}
    \begin{aligned}
    x_{n+1} &= x_n - \frac{f(x_n)}{f'(x_0)} \\
    e_{n+1} = f(x_{n+1}) &= f(x_n) + f'(x_n) (x_{n+1}-x_n) + O(x_{n+1}-x_n) \\
        &= f(x_n) - \frac{f'(x_n)\cdot f(x_n)}{f'(x_0)} + O(x_{n+1}-x_n) \\
        &= (1-\frac{f'(x_n)}{f'(x_0)})\cdot e_n \\
        So \ s=1,\ C = 1 - \frac{f'(x_n)}{f'(x_0)}\ 
\end{aligned}
    \notag
\end{equation}
\end{proof}

\subsection*{\uppercase\expandafter{\romannumeral5}}
\begin{solution}
\begin{equation}
    \begin{aligned}
    x_{n+1} &= \arctan x_n \\
    g(x) &= \arctan(x)\\
    g : [-\frac{\pi}{2},\frac{\pi}{2}] \to [-\frac{\pi}{2},\frac{\pi}{2}] & \ is \ a \ contraction \\
    \end{aligned}
    \notag
\end{equation}
    So\ it\ converges\ to\ the\ fixed\ point\ x\ =\ 0.
\end{solution}

\subsection*{\uppercase\expandafter{\romannumeral6}}
\begin{solution}
 Proof: \\
$$
Let\ g(x) = \frac{1}{p+x}
$$
$$
g(x_n)=g(x_{n-1}) \ and \ x_0 = 0
$$
$$
So\ x_1 = \frac{1}{p},\ x_2 = \frac{1}{p+\frac{1}{p}},
 \ x_3 = \frac{1}{p+\frac{1}{p}}
$$
$$
g : [0,1] \ \xrightarrow{} \ [0,1] \ is \ a \ contraction
$$
$$
x = \frac{1}{p+\frac{1}{p+\frac{1}{p+\cdots}}} = \lim_{n \to \infty} x_n \ is\ a\ fixed\ point.
$$
$$
Let\ g(x)=x,\ we\ can\ get\ \frac{1}{p+x}=x \ 
$$
$$
x = \frac{-p+\sqrt{p^2+4}}{2}
$$
\end{solution}

\subsection*{\uppercase\expandafter{\romannumeral7}}
\begin{solution}
 \begin{equation}
    \begin{aligned}
        a_0 &< 0 < b_0 \\
    |x_n - x^*| &\leqslant \frac{b_0-a_0}{2^n} \\
       \epsilon &= \frac{|x_n-x^*|}{|x^*|} \leqslant \frac{b_0-a_0}{2^n\cdot|x^*|} \\
    \end{aligned}
    \notag
\end{equation}
故  $ n  \geqslant log_2(b_0-a_0) - log_2\epsilon -log_2|x^*| $ 时,
      相对误差小于 $\epsilon$ \\
由于$|x^*|$可能接近0，故相对误差不好估计。
\end{solution}


\bibliographystyle{plain}
\bibliography{reference}
\end{document} 